<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>订单管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
	<style>
	.orderdetail{background:#f7f7f8;width: 94%;box-sizing:border-box;margin:0 10px;display:flex;flex-direction:column;}
	.orderdetail *{box-sizing:border-box;}
	.address{ display:flex;align-items:center;width: 100%; padding:10px 0; background: #FFF;color:#222}
	.address .img{width:45px;padding:0 10px}
	.address img{width:25px; height:25px;}
	.address .info{flex:1;display:flex;flex-direction:column;}
	.address .info .t1{ font-weight:bold}

	.express { width:100%;background: #fff; padding:10px;display:flex;align-items:center;margin-top:5px;color:#333}
	.express .f1{ width:40px;font-size:20px;color:#999}
	.express .f2{display:flex;flex-direction:column;flex:auto}

	.product{width:100%; padding:5px;background: #FFF;margin-top:5px;}
	.product .content{display:flex;}
	.product .box{position:relative;width: 100%; padding:5px 0px;border-bottom: 1px #e5e5e5 dashed;position:relative}
	.product .content{display:flex;position:relative;}
	.product .box:last-child{ border-bottom: 0; }
	.product .content img{ width: 70px; height: 70px;}
	.product .content .detail{display:flex;flex-direction:column;margin-left:7px;flex:1}
	.product .content .detail .t1{height: 30px;line-height: 15px;color: #000;}
	.product .content .detail .t2{height: 23px;line-height: 23px;color: #999;overflow: hidden;font-size:13px;}
	.product .content .detail .t3{display:flex;height:15px;line-height:15px;color: #ff4246;}
	.product .content .detail .x1{ flex:1}
	.product .content .detail .x2{ width:50px;font-size:16px;text-align:right;margin-right:4px}
	.product .content .comment{position:absolute;top:32px;right:5px;border: 1px #ffc702 solid; border-radius:5px;background:#fff; color: #ffc702;  padding: 0 5px; height: 23px; line-height: 23px;}

	.orderinfo{ width:100%;margin-top:5px;padding: 5px;background: #FFF;}
	.orderinfo .item{display:flex;width:100%;padding:10px 0;border-bottom:1px dashed #ededed;overflow:hidden}
	.orderinfo .item:last-child{ border-bottom: 0;}
	.orderinfo .item .t1{width:100px;flex-shrink:0}
	.orderinfo .item .t2{flex:1;text-align:right;}
	.orderinfo .item .red{color:red}

	.logistics{ width: 94%;  background: #fff; padding: 0 10px;display:flex;flex-direction:column;color: #979797;}
	.logistics .on{color: #23aa5e;}
	.logistics .item{display:flex;width: 96%;  margin: 0 2%;/*border-left: 1px #dadada solid;*/padding:0 0}
	.logistics .item .f1{ width:30px;position:relative}
	/*.logistics img{width: 15px; height: 15px; position: absolute; left: -8px; top:11px;}*/
	.logistics .item .f1 img{ width: 15px; height: 100%;}

	.logistics .item .f2{display:flex;flex-direction:column;flex:auto;padding:5px 0}
	.logistics .item .f2 .t1{font-size: 15px;}
	.logistics .item .f2 .t1{font-size: 13px;}

	.glassitem{    background: #f5f5f5;
		padding: 5px;
		font-size: 12px;
		border-radius: 6px;
		margin-top: 5px;}
	.glassitem .bt{border-top:1px solid #e3e3e3}
	</style>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-card layui-col-md12">
          <div class="layui-card-header">
			<div class="layui-tab layui-tab-brief">
				<ul class="layui-tab-title">
					<li {if !input('?param.status') || input('param.status')===''}class="layui-this"{/if} onclick="location.href='{:url('index')}/showtype/{$Request.param.showtype}'">全部订单</li>
					<li {if input('param.status')==='0'}class="layui-this"{/if} onclick="location.href='{:url('index')}/status/0/showtype/{$Request.param.showtype}'">未支付</li>
					<li {if input('param.status')=='1'}class="layui-this"{/if} onclick="location.href='{:url('index')}/status/1/showtype/{$Request.param.showtype}'">待发货</li>
					<li {if input('param.status')=='2'}class="layui-this"{/if} onclick="location.href='{:url('index')}/status/2/showtype/{$Request.param.showtype}'">已发货</li>
					<li {if input('param.status')=='3'}class="layui-this"{/if} onclick="location.href='{:url('index')}/status/3/showtype/{$Request.param.showtype}'">已完成</li>
					<li {if input('param.status')=='4'}class="layui-this"{/if} onclick="location.href='{:url('index')}/status/4/showtype/{$Request.param.showtype}'">已关闭</li>
					
					<!-- <li {if input('param.status')=='5'}class="layui-this"{/if} onclick="location.href='{:url('index')}/status/5'">退款中</li> -->
				</ul>
			</div>
			{if input('param.isopen')==1}<i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i>{/if}
          </div>
          <div class="layui-card-body" pad15>
						<div class="layui-col-md2" style="padding-bottom:10px">
							<button class="layui-btn layui-btn-primary layuiadmin-btn-list" onclick="location.href='{:url('excel')}'+urlEncode(datawhere)">导出</button>
							<button class="layui-btn layui-btn-primary layuiadmin-btn-list" onclick="plfh()">批量发货</button>
							
							
							{if $adminset['fhjiesuantime_type']==0 && $adminset['fhjiesuantime'] == 10}
							<button class="layui-btn layui-btn-primary layuiadmin-btn-list" onclick="fhjiesuan()">结算分红</button>
							{/if}
						</div>
						<div class="layui-col-md10 layui-form" style="text-align:right;padding-bottom:10px">
							{if input('?param.showtype') && input('param.showtype')!==''}
							<input type="hidden" name="showtype" value="{$Request.param.showtype}">
							{/if}
							<div class="layui-inline layuiadmin-input-useradmin" style="display:none">
								<label class="layui-form-label" style="width:50px">{:t('会员')}ID</label>
								<div class="layui-input-block" style="width:120px;margin-left:80px">
									<input type="text" name="mid" value="{$Request.param.mid}" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-inline">
								<div class="layui-input-block" style="width:100px;margin-left:30px;text-align:left">
									<select name="keyword_type">
										<option value="1">订单号</option>
										<option value="2">{:t('会员')}ID</option>
										<option value="3">{:t('会员')}信息</option>
										<option value="4">收货信息</option>
										<option value="5">快递单号</option>
										<option value="6">商品ID</option>
										<option value="7">商品名称</option>
										<option value="8">商品编码</option>
										<option value="9">核销员</option>
										<option value="10">所属门店</option>
									</select>
								</div>
							</div>
							<div class="layui-inline">
								<div class="layui-input-block" style="width:150px;margin-left:0px">
									<input type="text" name="keyword" placeholder="" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-inline">
								<div class="layui-input-block" style="width:100px;margin-left:30px;text-align:left">
									<select name="time_type">
										<option value="1">下单时间</option>
										<option value="2">付款时间</option>
										<option value="3">发货时间</option>
										<option value="4">完成时间</option>
									</select>
								</div>
							</div>
							<div class="layui-inline">
								<div class="layui-input-block" style="width:300px;margin-left:0px">
									<input type="text" name="ctime" id="ctime" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label" style="width:60px">配送方式</label>
								<div class="layui-input-block" style="width:120px;margin-left:90px;text-align:left">
									<select name="freight_id">
										<option value="">全部</option>
										{foreach $freight as $item}
										<option value="{$item.id}" {if input('param.freight_id')==$item.id}selected{/if}>{$item.name}</option>
										{/foreach}
									</select>
								</div>
							</div>
							
							<div class="layui-inline">
								<label class="layui-form-label" style="width:60px">转账审核</label>
								<div class="layui-input-block" style="width:120px;margin-left:90px;text-align:left">
									<select name="transfer_check">
										<option value="">全部</option>
										<option value="-1" {if input('param.transfer_check')==='0'}selected{/if}>已驳回</option>
										<option value="0" {if input('param.transfer_check')==='1'}selected{/if}>待审核</option>
										<option value="1" {if input('param.transfer_check')==='2'}selected{/if}>已通过</option>
									</select>
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label" style="width:30px">状态</label>
								<div class="layui-input-block" style="width:120px;margin-left:60px;text-align:left">
									<select name="status">
										<option value="">全部</option>
										<option value="0" {if input('param.status')==='0'}selected{/if}>未支付</option>
										<option value="1" {if input('param.status')==='1'}selected{/if}>待发货</option>
										<option value="2" {if input('param.status')==='2'}selected{/if}>已发货</option>
										
										<option value="3" {if input('param.status')==='3'}selected{/if}>已收货</option>
										<option value="4" {if input('param.status')==='4'}selected{/if}>已关闭</option>
										<!-- <option value="5" {if input('param.status')==='5'}selected{/if}>退款待审核</option> -->
										<option value="6" {if input('param.status')==='6'}selected{/if}>已退款</option>
										<!-- <option value="7" {if input('param.status')==='7'}selected{/if}>退款驳回</option> -->
									</select>
								</div>
							</div>
							<div class="layui-inline">
								<button class="layui-btn layuiadmin-btn-replys" lay-submit="" lay-filter="LAY-app-forumreply-search">
									<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
								</button>
							</div>
						</div>
						{if input('param.fxmid')}
						<div class="layui-col-md12" style="font-weight:bold">{:t('会员')}ID:{$Request.param.fxmid}&nbsp;&nbsp;获得的累计佣金￥<span id="totalcommission"></span></div>
						{/if}
						<div class="layui-col-md12">
							<table id="tabledata" lay-filter="tabledata"></table>
						</div>
          </div>
        </div>
    </div>
  </div>
	{include file="public/js"/}
	<script>
  var table = layui.table;
	var datawhere = {};
	{if input('?param.status') && input('param.status')!==''}
	datawhere['status'] = "{$Request.param.status}";
	{/if}
	{if input('?param.showtype') && input('param.showtype')!==''}
	datawhere['showtype'] = "{$Request.param.showtype}";
	{/if}
	{if input('?param.fxmid') && input('param.fxmid')!==''}
	datawhere['fxmid'] = "{$Request.param.fxmid}";
	{/if}
  //数据表
  var tableIns = table.render({
    elem: '#tabledata'
    ,url: "{$Request.url}" //数据接口
    ,page: true //开启分页
		//,size:'sm'
    ,cols: [[ //表头
			{type:"checkbox"},
      {field: 'id', title: 'ID',  sort: true,width:60},
			{if input('param.showtype')==2}
      {field: 'bname', title: '所属商户',width:160},
			{/if}
      {field: 'goodsdata', title: '商品信息',width:260},
      {field: 'ordernum', title: '订单号/下单时间',sort: true,width:160,templet:function(d){ return d.ordernum +'<div style="color:#080">'+ date('Y年m月d日 H:i',d.createtime)+'</div>'}},
      {field: 'product_price', title: '商品总价/实付款',width:150,templet: '<div><div>总价：￥{{d.product_price}}</div><div style="font-weight:bold">实付：￥{{d.totalprice}}</div></div>'},
      //{field: 'totalprice', title: '实付款'},
      {field: 'address', title: '收货地址',templet: '<div><div style="font-weight:bold">{{d.linkman}} {{#if(d.company){ }}{{d.company}}{{# } }} {{d.tel}} </div><div style="line-height:20px;font-size:12px">{{d.area}} {{d.address}}</div>{{#if(d.message){ }}<!-- <div style="line-height:20px;font-size:12px;color:#e55555">客户留言：{{d.message}}</div> -->{{# } }}</div>'},
			{field: 'platform', title: '来源',width:100},
			{field: 'nickname', title: '头像昵称',width:120,templet:function(d){
				var html = '';
				if(d.headimg) html +='<img src="'+d.headimg+'" style="height:50px"/> ';
				if(d.nickname) html += d.nickname;
				if(d.m_remark){
					html += '<br><span style="color:#f55">'+d.m_remark+'</span>';
				}
				return html;
      }},
		  {if $order_show_member_apply}
		  {field: 'member_apply_info', title: '下单人',width:120},
		  {/if}
			{field: 'paytype', title: '支付方式',width:150,templet:function(d){
				var html = '';
				if(d.paytype){
					html += d.paytype;
				}
				if(d.is_yuanbao_pay){
					html += "<br>(元宝："+d.total_yuanbao+")";
				}
				return html;
			}},
			{field: 'freight_text', title: '配送方式',width:150},
	  
      {field: 'status', title: '状态',templet:function(d){
				var html = '';
				if(d.status==0) html+='<div style="color:#ff8758">未支付</span>';
				if(d.status==1 && d.paytypeid!='4') html+='<div style="color:#008000">已支付</span>';
				if(d.status==1 && d.paytypeid=='4') html+='<div style="color:#008000">待发货</span>';
				if(d.status==2){
					if(d.express_isbufen == 1){
						html+='<div style="color:#ff4246">部分发货</span>';
					}else{
						html+='<div style="color:#ff4246">已发货</span>';
					}
				}
				if(d.status==3) html+='<div style="color:#999">已完成</span>';
				if(d.status==4) html+='<div style="color:#bbb">已关闭</span>';
				if(d.refund_status == 1) html+='<div style="color:red">退款待审核,￥'+d.refund_money+'</div>';
				if(d.refund_status == 2) html+='<div style="color:red">已退款,￥'+d.refund_money+'</div>';
				if(d.refund_status == 3) html+='<div style="color:red">退款驳回,￥'+d.refund_money+'</div>';
				if(d.balance_price > 0) html+='<div style="color:red">尾款￥'+d.balance_price+','+(d.balance_pay_status==0?'未支付':'已支付')+'</div>';
				if(d.refundCount > 0)  html+='<div><a href="javascript:void(0)" style="color:red" onclick="openmax(\'{:url('ShopRefundOrder/index')}/bid/'+d.bid+'/orderid/'+d.id+'/isopen/1\')">有退款（'+d.refundCount+'）</a></div>';
				return html;
			}},
		
      //{field: 'createtime', title: '下单时间',sort: true,templet:function(d){ return date('Y-m-d H:i',d.createtime)},width:150},
      {field: 'operation', title: '操作',minWidth:160,templet:function(d){
				var html = '';
				if(d.paytypeid==5 && d.payorder.check_status>=0){
					if(d.transfer_check == 1){
						html += '<button class="table-btn" onclick="doOperation('+d.id+',\'付款凭证\')">付款凭证</button>';
					}else if(d.transfer_check == 0){
						html += '<button class="table-btn" onclick="doOperation('+d.id+',\'转账审核\')">转账审核</button>';
					}else if(d.transfer_check == -1){
						html += '<button class="table-btn" style="background:#eee">转账已驳回</button>';
					}
				}
				html += '<button class="table-btn" onclick="showdetail('+d.id+')">详情</button>';

				html += '<button class="table-btn" onclick="openmax(\'{:url('shd')}/id/'+d.id+'\')">送货单</button>';
				{if $hasprint}
				html += '<button class="table-btn" onclick="wifiprint('+d.id+')">打印小票</button>';
				{/if}
				{if $bid==0}html += '<button class="table-btn" onclick="openmax(\'{:url('edit')}/id/'+d.id+'\')">修改</button>';{/if}
				html += '<button class="table-btn" onclick="datadel('+d.id+')">删除</button><br/>';
				if(d.refund_status==1){ //退款待审核
					html += '<button class="table-btn" onclick="doOperation('+d.id+',\'退款审核\')">退款审核</button>';
				}
				if(d.status==0){ //未支付
					html += '<button class="table-btn" onclick="doOperation('+d.id+',\'关闭订单\')">关闭订单</button>';
					{if $bid==0}html += '<button class="table-btn" onclick="doOperation('+d.id+',\'已支付\')">改为已支付</button>';{/if}
				}
				if(d.status==1){ //已支付
					html += '<button class="table-btn" onclick="doOperation('+d.id+',\'发货\')">发货</button>';
					if(d.freight_type==1){
						html += '<button class="table-btn" onclick="doOperation('+d.id+',\'核销\')">核销</button>';
						html += '<button class="table-btn" onclick="dialog(\''+d.hexiao_code_member+'\')">{:t('会员')}核销密码</button>';
					}

					if(d.freight_type==2 && '{$peisong_set.status}'==1 && '{$peisong_set.express_wx_status}'!=1)
						html += '<button class="table-btn" onclick="doOperation('+d.id+',\'配送员配送\')">配送</button>';
					if(d.freight_type==2 && '{$peisong_set.status}'==1 && '{$peisong_set.express_wx_status}'==1)
						html += '<button class="table-btn" onclick="doOperation('+d.id+',\'即时配送\')">即时配送派单</button>';
					html += '<button class="table-btn" onclick="doOperation('+d.id+',\'退款\')">退款</button>';
				}
				if(d.status==2){ //已发货
					html += '<button class="table-btn" onclick="doOperation('+d.id+',\'查物流\')">查物流</button>';
					html += '<button class="table-btn" onclick="doOperation('+d.id+',\'发货\')">改物流</button>';
					if(d.freight_type==1){
						html += '<button class="table-btn" onclick="doOperation('+d.id+',\'核销\')">核销</button>';
					}
					{if $bid==0}
					html += '<button class="table-btn" onclick="doOperation('+d.id+',\'确认收货\')">确认收货</button>';
					{else}
					if(d.paytypeid==4){
						html += '<button class="table-btn" onclick="doOperation('+d.id+',\'确认收货\')">确认收货</button>';
					}
					{/if}
					html += '<button class="table-btn" onclick="doOperation('+d.id+',\'退款\')">退款</button>';
				}
				if(d.status==3){ //已完成
					html += '<button class="table-btn" onclick="doOperation('+d.id+',\'查物流\')">查物流</button>';
				}
				return html;
      }}
    ]]
		,done:function(res, curr, count){
			{if input('param.fxmid')}
			if(curr == 1){
				$('#totalcommission').html(res.totalcommission);
			}
			{/if}
		}
  });
	//排序
	table.on('sort(tabledata)', function(obj){
		datawhere.field = obj.field;
		datawhere.order = obj.type;
		tableIns.reload({
			initSort: obj,
			where: datawhere
		});
	});
	//日期范围选择
	layui.laydate.render({ 
		elem: '#ctime',
		trigger: 'click',
		type:'datetime',
		range: '~' //或 range: '~' 来自定义分割字符
	});
	//检索
	layui.form.on('submit(LAY-app-forumreply-search)', function(obj){
		var field = obj.field
		var olddatawhere = datawhere
		datawhere = field
		datawhere.field = olddatawhere.field
		datawhere.order = olddatawhere.order
		tableIns.reload({
			where: datawhere,
			page: {curr: 1}
		});
	})
	//打印小票
	function wifiprint(id){
		layer.confirm('确定要打印小票吗?',{icon: 7, title:'操作确认'}, function(index){
			layer.close(index);
			var index = layer.load();
			$.post("{:url('wifiprint')}",{id:id},function(data){
				layer.close(index);
				dialog(data.msg,data.status);
			})
		})
	}
	//删除
	function datadel(id){
		layer.confirm('确定要删除吗?',{icon: 7, title:'操作确认'}, function(index){
			//do something
			layer.close(index);
			var index = layer.load();
			$.post("{:url('del')}",{id:id},function(data){
				layer.close(index);
				dialog(data.msg,data.status);
				tableIns.reload()
			})
		});
	}
	var tuikuandata = {};
	var detailLayer;
	function showdetail(orderid){
		var index = layer.load();
		$.post("{:url('getdetail')}",{orderid:orderid},function(data){
			layer.close(index);
			var html = '';
			//var data = { //数据
			//	"title":"Layui常用模块",
			//	"list":[{"modname":"弹层","alias":"layer","site":"layer.layui.com"},{"modname":"表单","alias":"form"}]
			//}
			layui.laytpl(detailtpl.innerHTML).render(data, function(html){
				//view.innerHTML = html;
				var detailBtn = [];
				if(data.order.refund_status==1){ //退款待审核
					detailBtn.push('退款审核');
				}
				if(data.order.status==0){ //未支付
					detailBtn.push('关闭订单');
					{if $bid==0}detailBtn.push('已支付');{/if}
					detailBtn.push('改价');
				}
				if(data.order.status==1){ //已支付
					detailBtn.push('发货');
					if(data.order.freight_type==1)
						detailBtn.push('核销');
					if(data.order.freight_type==2 && '{$peisong_set.status}'==1 && '{$peisong_set.express_wx_status}'!=1) detailBtn.push('配送员配送');
					if(data.order.freight_type==2 && '{$peisong_set.status}'==1 && '{$peisong_set.express_wx_status}'==1) detailBtn.push('即时配送');
					detailBtn.push('退款');
				}
				if(data.order.status==2){ //已发货
					detailBtn.push('查物流');
					if(data.order.freight_type==1){
						detailBtn.push('核销');
					}
					{if $bid==0}
					detailBtn.push('确认收货');
					{else}
					if(data.order.paytypeid==4){
						detailBtn.push('确认收货');
					}
					{/if}
				}
				if(data.order.status==3){ //已完成
					detailBtn.push('查物流');
				}
				//if(data.order.status==4){ //已关闭
					detailBtn.push('删除');
				//}
				detailBtn.push('设置备注');
				detailLayer = layer.open({type:1,title:'订单详情',area:'500px',content:html,resize:true,shadeClose:true,maxmin:true,btn:detailBtn,
					yes:function(){
						return btnOperation(detailBtn[0],data);
					},
					btn2:function(){
						return btnOperation(detailBtn[1],data);
					},
					btn3:function(){
						return btnOperation(detailBtn[2],data);
					},
					btn4:function(){
						return btnOperation(detailBtn[3],data);
					},
					btn5:function(){
						return btnOperation(detailBtn[4],data);
					}
				});
			});
			//layer.open({type:1,area:['600px','600px'],title:false,shadeClose:true,btn: ['发货', '退款审核', '设置备注']});
		})
	}
	var orderdata = {};
	function doOperation(orderid,type){
		var index_load = layer.load();
		$.post("{:url('getdetail')}",{orderid:orderid},function(data){
			layer.close(index_load);
			orderdata = data;
			btnOperation(type,data);
		})
	}
	function btnOperation(type,data){
		var orderid = data.order.id;

		
		if(type=='退款审核'){
			layui.laytpl(refundCheckTpl.innerHTML).render(data.order, function(html){
				var refundCheckLayer = layer.open({type:1,title:false,content:html,shadeClose:true,btn: ['同意并退款', '驳回退款申请'],
					yes:function(){
						var index = layer.load();
						$.post("{:url('refundCheck')}",{orderid:orderid,st:1,remark:$('input[name=refund_checkremark]').val()},function(res){
							layer.close(index);
							dialog(res.msg,res.status);
							layer.close(refundCheckLayer);
							layer.close(detailLayer);
							tableIns.reload()
						})
					},
					btn2:function(){
						var index = layer.load();
						$.post("{:url('refundCheck')}",{orderid:orderid,st:2,remark:$('input[name=refund_checkremark]').val()},function(res){
							layer.close(index);
							dialog(res.msg,res.status);
							layer.close(refundCheckLayer);
							layer.close(detailLayer);
							tableIns.reload()
						})
					}
				})
			})
		}else if(type == '发货'){
			if(data.order.freight_type==10){ //货运托运
				var html = '<div style="margin:20px auto;">';
				html+='<div class="layui-form" lay-filter="">';
				html+='	<div class="layui-form-item">';
				html+='		<label class="layui-form-label" style="width:110px">物流单照片：</label>';
				html+='		<div class="layui-input-inline" style="width:300px">';
				html+='			<input type="text" name="express_pic" id="express_pic" class="layui-input">';
				html+='		</div>';
				html+='		<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="express_pic" upload-preview="express_picPreview" onclick="uploader(this)">上传</button>';
				html+='		<div id="express_picPreview" style="float:left;padding-top:10px;padding-left:140px;clear: both;">';
				html+='			<div class="layui-imgbox" style="width:100px;"><div class="layui-imgbox-img"><img src=""/></div></div>';
				html+='		</div>';
				html+='	</div>';
				html+='	<div class="layui-form-item">';
				html+='		<label class="layui-form-label" style="width:110px">发货人</label>';
				html+='		<div class="layui-input-inline" style="width:300px">';
				html+='			<input type="text" name="express_fhname" id="express_fhname" class="layui-input">';
				html+='		</div>';
				html+='	</div>';
				html+='	<div class="layui-form-item">';
				html+='		<label class="layui-form-label" style="width:110px">发货地点</label>';
				html+='		<div class="layui-input-inline" style="width:300px">';
				html+='			<input type="text" name="express_fhaddress" id="express_fhaddress" class="layui-input">';
				html+='		</div>';
				html+='		<div class="layui-form-mid"></div>';
				html+='	</div>';
				html+='	<div class="layui-form-item">';
				html+='		<label class="layui-form-label" style="width:110px">收货人</label>';
				html+='		<div class="layui-input-inline" style="width:300px">';
				html+='			<input type="text" name="express_shname" id="express_shname" class="layui-input">';
				html+='		</div>';
				html+='	</div>';
				html+='	<div class="layui-form-item">';
				html+='		<label class="layui-form-label" style="width:110px">收货地点</label>';
				html+='		<div class="layui-input-inline" style="width:300px">';
				html+='			<input type="text" name="express_shaddress" id="express_shaddress" class="layui-input">';
				html+='		</div>';
				html+='		<div class="layui-form-mid"></div>';
				html+='	</div>';
				html+='	<div class="layui-form-item">';
				html+='		<label class="layui-form-label" style="width:110px">备注</label>';
				html+='		<div class="layui-input-inline" style="width:300px">';
				html+='			<input type="text" name="express_remark" id="express_remark" class="layui-input">';
				html+='		</div>';
				html+='		<div class="layui-form-mid"></div>';
				html+='	</div>';
				//html+='	<div class="layui-form-item" style="margin-top:30px">';
				//html+='		<label class="layui-form-label" style="width:110px"></label>';
				//html+='		<div class="layui-input-inline">';
				//html+='			<button class="layui-btn layui-btn-normal" lay-submit lay-filter="submit_excel">确定</button>';
				//html+='		</div>';
				//html+='	</div>';
				html+='</div>';
				html+='</div>'
				var sendExpressLayer = layer.open({type:1,area: ['600px', '530px'],title:false,content:html,shadeClose:true,btn: ['确定', '取消'],yes:function(){
						var index = layer.load();
						$.post("{:url('sendExpress')}",{orderid:orderid,pic:$('#express_pic').val(),fhname:$('#express_fhname').val(),fhaddress:$('#express_fhaddress').val(),shname:$('#express_shname').val(),shaddress:$('#express_shaddress').val(),remark:$('#express_remark').val()},function(res){
							layer.close(index);
							dialog(res.msg,res.status);
							layer.close(sendExpressLayer);
							layer.close(detailLayer);
							tableIns.reload()
						});
					}
				});
				layui.form.render();
				return;
			}
			if(data.canmiandan==1){
				var fahuotypeLayer = layer.open({type:0,title:'请选择发货方式',content:'是否要使用小程序物流助手发货?',shadeClose:true,btn: ['使用物流助手发货', '手动发货'],
					yes:function(){
						layer.close(fahuotypeLayer);
						layer.close(detailLayer);
						layer.open({type:2,title:'创建运单',area:['900px','90%'],content:"{:url('miandan/addorder')}/ordertype/shop_order/orderid/"+orderid,scrollbar:false});
					},
					btn2:function(){
						layui.laytpl(sendExpressTpl.innerHTML).render(data, function(html){
							var sendExpressLayer = layer.open({type:1,title:'订单发货',area:['600px','600px'],content:html,shadeClose:true,btn: ['确定', '取消'],
								yes:function(){
									var express_com = [];
									$("select[name='send_express[]']").each(function(){
										express_com.push($(this).val());
									})
									var express_no = [];
									$("input[name='send_express_no[]']").each(function(){
										express_no.push($(this).val());
									})
									var index = layer.load();
									$.post("{:url('sendExpress')}",{orderid:orderid,express_com:express_com,express_no:express_no},function(res){
										layer.close(index);
										dialog(res.msg,res.status);
										layer.close(sendExpressLayer);
										layer.close(detailLayer);
										tableIns.reload()
									})
								}
							});
							layui.form.render();
						});
					}
				})
			}else{
				layui.laytpl(sendExpressTpl.innerHTML).render(data, function(html){
					var sendExpressLayer = layer.open({type:1,title:'订单发货',area:['600px','600px'],content:html,shadeClose:true,btn: ['确定', '取消'],
						yes:function(){
							var express_com = [];
							$("select[name='send_express[]']").each(function(){
								express_com.push($(this).val());
							})
							var express_no = [];
							$("input[name='send_express_no[]']").each(function(){
								express_no.push($(this).val());
							});
							var express_ogids = [];
							$(".send_express_ogids").each(function(){
								var thisogids = [];
								$(this).find('.layui-form-checked').each(function(){
									thisogids.push($(this).prev().val());
								});
								express_ogids.push(thisogids.join(','));
							});
							var index = layer.load();
							$.post("{:url('sendExpress')}",{orderid:orderid,express_com:express_com,express_no:express_no,express_ogids:express_ogids},function(res){
								layer.close(index);
								dialog(res.msg,res.status);
								layer.close(sendExpressLayer);
								layer.close(detailLayer);
								tableIns.reload()
							})
						}
					});
					layui.form.render();
				});
			}
		}else if(type == '配送员配送'){
			var index = layer.load();
			$.post("{:url('Peisong/getpeisonguser')}",{type:'shop_order',orderid:orderid},function(res){
				layer.close(index);
				if(res.status == 0) {
					dialog(res.msg,res.status);return;
				}
				var peisonguser = res.peisonguser
				var paidantype = res.paidantype
				var psfee = res.psfee
				var ticheng = res.ticheng
				var html = '';
				html+='	<div class="layui-form-item" style="margin-top:40px;margin-right:20px;">';
				if(paidantype == 1){
					html+='		<label class="layui-form-label" style="width:80px">选择配送员</label>';
					html+='		<div class="layui-input-inline" style="width:350px">';
					html+='			<select id="peisonguser" style="width:100%;height: 38px;line-height: 38px;border:1px solid #e6e6e6;background-color: #fff;border-radius: 2px;">';
					for(var i in peisonguser){
						html+='			<option value="'+peisonguser[i].id+'">'+peisonguser[i].title+'</option>';
					}
					html+='			</select>';
					html+='		</div>';
				}else{
					if(data.order.bid == 0){
						html+='		<div class="layui-form-mid" style="margin:0 20px">选择配送员配送，订单将发布到抢单大厅由配送员抢单，配送员提成￥'+ticheng+'，确定要配送员配送吗？</div>';
					}else{
						html+='		<div class="layui-form-mid" style="margin:0 20px">选择配送员配送，订单将发布到抢单大厅由配送员抢单，需扣除配送费￥'+psfee+'，确定要配送员配送吗？</div>';
					}
				}
				html+='	</div>';
				var peisongLayer = layer.open({type:1,area:['500px','250px'],title:false,content:html,shadeClose:true,btn: ['确定', '取消'],
					yes:function(){
						var index = layer.load();
						if(paidantype == 1){
							var psid = $('#peisonguser').val();
						}else if(paidantype == 2){
							var psid = '-1';
						}else{
							var psid = '0';
						}
						$.post("{:url('Peisong/peisong')}",{type:'shop_order',orderid:orderid,psid:psid},function(res){
							layer.close(index);
							dialog(res.msg,res.status);
							layer.close(peisongLayer);
							layer.close(detailLayer);
							tableIns.reload()
						})
					}
				})
				layui.form.render();
			})
		}else if(type == '即时配送'){
			var index = layer.load();layer.close(index);
			var psfee = data.freight_price
			var html = '';
			html+='	<div class="layui-form-item" style="margin-top:40px;margin-right:20px;">';
			if(data.order.bid == 0){
				html+='		<div class="layui-form-mid" style="margin:0 20px">选择即时配送，订单将派单到第三方配送平台，并扣除相应费用，确定要派单吗？</div>';
			}else{
				html+='		<div class="layui-form-mid" style="margin:0 20px">选择即时配送，订单将派单到第三方配送平台，需扣除配送费￥'+psfee+'，确定要派单吗？</div>';
			}
			html+='	</div>';
			var peisongLayer = layer.open({type:1,area:['500px','250px'],title:false,content:html,shadeClose:true,btn: ['确定', '取消'],
				yes:function(){
					var index = layer.load();
					var psid = '0';
					$.post("{:url('Peisong/wx_addorder')}",{type:'shop_order',orderid:orderid,psid:psid},function(res){
						layer.close(index);
						dialog(res.msg,res.status);
						layer.close(peisongLayer);
						layer.close(detailLayer);
						tableIns.reload()
					})
				}
			})
			layui.form.render();
		}else if(type == '退款'){
			// 商品
			// 退款价格
			// var html = '';
			// html+='	<div class="layui-form-item" style="margin-top:40px;margin-right:20px;">';
			// html+='		<label class="layui-form-label" style="width:80px">退款原因</label>';
			// html+='		<div class="layui-input-inline" style="width:350px">';
			// html+='			<textarea type="text" id="tuireason" class="layui-textarea"></textarea>';
			// html+='		</div>';
			// html+='	</div>';
			// var refundLayer = layer.open({type:1,area:['500px','250px'],title:false,content:html,shadeClose:true,btn: ['确定', '取消'],
			// 	yes:function(){
			// 		var index = layer.load();
			// 		$.post("{:url('refund')}",{orderid:orderid,reason:$('#tuireason').val()},function(res){
			// 			layer.close(index);
			// 			dialog(res.msg,res.status);
			// 			layer.close(refundLayer);
			// 			layer.close(detailLayer);
			// 			tableIns.reload()
			// 		})
			// 	}
			// })
			var index_load = layer.load();
			$.post("{:url('refundinit')}",{orderid:orderid},function(data) {
				tuikuandata = data;
				layer.close(index_load);
				layui.laytpl(refundtpl.innerHTML).render(data, function(html){
					var refundLayer = layer.open({type:1,title:'退款',area:'500px',content:html,resize:true,shadeClose:true,maxmin:true,btn: ['确定', '取消'],
						yes:function(){
							var reason = $('#tuireason').val();
							var refundNum = [];
							var money = $('#refund_money').val();
							$(".refundNum").each(function(){
								refundNum.push({ogid:$(this).attr('data-ogid'),num:$(this).val()})
							});
							var refund_type = $("input[name=refund_type]").val();
							// console.log(refund_type);return;
							if(reason == '') {
								layer.msg('请填写退款原因');return false;
							}
							if(money < 0) {
								layer.msg('请输入正确的退款金额');return false;
							}

							var index = layer.load();
							$.post("{:url('refund')}",{orderid:orderid,money: money,reason:reason,refundNum:refundNum},function(res){
								layer.close(index);
								dialog(res.msg,res.status);
								layer.close(refundLayer);
								layer.close(detailLayer);
								tableIns.reload()
							})
						}
					})
				});
			});

		}else if(type == '查物流'){
			var index = layer.load();
			$.post("{:url('getExpress')}",{orderid:orderid},function(res){
				var expressdata = res.data
				layer.close(index);
				if(data.order.freight_type==10){
					var html = '';
					html+='<div class="orderinfo" style="width:450px;margin-left:20px">';
					html+='	<div class="item">';
					html+='		<span class="t1">物流单照片</span>';
					html+='		<span class="t2"><img src="'+expressdata.pic+'" style="width:350px;height:auto"/></span>';
					html+='	</div>';
					html+='	<div class="item">';
					html+='		<span class="t1">发货人</span>';
					html+='		<span class="t2">'+expressdata.fhname+'</span>';
					html+='	</div>';
					html+='	<div class="item">';
					html+='		<span class="t1">发货地址</span>';
					html+='		<span class="t2">'+expressdata.fhaddress+'</span>';
					html+='	</div>';
					html+='	<div class="item">';
					html+='		<span class="t1">收货人</span>';
					html+='		<span class="t2">'+expressdata.shname+'</span>';
					html+='	</div>';
					html+='	<div class="item">';
					html+='		<span class="t1">收货地址</span>';
					html+='		<span class="t2">'+expressdata.shaddress+'</span>';
					html+='	</div>';
					html+='	<div class="item">';
					html+='		<span class="t1">备注</span>';
					html+='		<span class="t2">'+expressdata.remark+'</span>';
					html+='	</div>';
					html+='</div>';
					var logisticsLayer = layer.open({type:1,area:['500px','650px'],title:false,content:html,shadeClose:true,btn: ['修改', '关闭'],
						yes:function(){
							layer.close(logisticsLayer);
							doOperation(orderid,'发货');
						}
					})
					return ;
				}
				layui.laytpl(logisticsTpl.innerHTML).render(res, function(html){
					var logisticsLayer = layer.open({type:1,title:'查看物流',content:html,area:"800px",shadeClose:true,btn: ['修改', '关闭'],
						yes:function(){
							layer.close(logisticsLayer);
							doOperation(orderid,'发货');
						}
					})
				})
			});
		}else if(type == '设置备注'){
			layui.laytpl(remarktpl.innerHTML).render({remark:data.order.remark}, function(html){
				var remarkLayer = layer.open({type:1,title:false,content:html,shadeClose:true,btn: ['确定', '取消'],
					yes:function(){
						var index = layer.load();
						$.post("{:url('setremark')}",{orderid:orderid,content:$('#remarkcontent').val()},function(res){
							layer.close(index);
							dialog(res.msg,res.status);
							layer.close(remarkLayer);
							layer.close(detailLayer);
						})
					}
				})
			});
		}else if(type == '已支付'){
			layer.confirm('确定要改为已支付吗?',{icon: 7, title:'操作确认'}, function(index){
				layer.close(index);
				var index = layer.load();
				$.post("{:url('ispay')}",{orderid:orderid},function(res){
					layer.close(index);
					dialog(res.msg,res.status);
					layer.close(detailLayer);
					tableIns.reload()
				})
			})
		}else if(type == '改价'){
			layui.laytpl(changepricetpl.innerHTML).render({totalprice:data.order.totalprice}, function(html){
				var changepriceLayer = layer.open({type:1,title:false,content:html,shadeClose:true,btn: ['确定', '取消'],
					yes:function(){
						var index = layer.load();
						$.post("{:url('changeprice')}",{orderid:orderid,newprice:$('#changepricecontent').val()},function(res){
							layer.close(index);
							dialog(res.msg,res.status);
							layer.close(changepriceLayer);
							layer.close(detailLayer);
							tableIns.reload()
						})
					}
				})
			});
		}else if(type == '关闭订单'){
			layer.confirm('确定要关闭该订单吗?',{icon: 7, title:'操作确认'}, function(index){
				layer.close(index);
				var index = layer.load();
				$.post("{:url('closeOrder')}",{orderid:orderid},function(res){
					layer.close(index);
					dialog(res.msg,res.status);
					layer.close(detailLayer);
					tableIns.reload()
				})
			})
		}else if(type == '删除'){
			layer.confirm('确定要删除该订单吗?',{icon: 7, title:'操作确认'}, function(index){
				layer.close(index);
				var index = layer.load();
				$.post("{:url('del')}",{id:orderid},function(res){
					layer.close(index);
					dialog(res.msg,res.status);
					layer.close(detailLayer);
					tableIns.reload()
				})
			})
		}else if(type == '确认收货'){
			layer.confirm('确定要改为已完成状态吗?',{icon: 7, title:'操作确认'}, function(index){
				layer.close(index);
				var index = layer.load();
				$.post("{:url('orderCollect')}",{orderid:orderid},function(res){
					layer.close(index);
					dialog(res.msg,res.status);
					layer.close(detailLayer);
					tableIns.reload()
				})
			})
		}else if(type == '核销'){
			layer.confirm('确定要核销并改为已完成状态吗?',{icon: 7, title:'操作确认'}, function(index){
				layer.close(index);
				var index = layer.load();
				$.post("{:url('orderHexiao')}",{orderid:orderid},function(res){
					layer.close(index);
					dialog(res.msg,res.status);
					layer.close(detailLayer);
					tableIns.reload()
				})
			})
		}
		return false;
	}
	//批量打印
	function plshd(id){
		var ids = [];
	
		if(id==0){
			var checkStatus = table.checkStatus('tabledata')
			var checkData = checkStatus.data; //得到选中的数据
			if(checkData.length === 0){
				return layer.msg('请选择数据');
			}
			var ids = [];
			for(var i=0;i<checkData.length;i++){
				ids.push(checkData[i]['id']);
			}
		}else{
			ids.push(id)
		}
		window.location.href = "{:url('plshd')}/ids/"+ids

		
	}
	//批量发货
	function plfh(){
		var html = '<div style="margin:20px auto;">';
		html+='<div class="layui-form" lay-filter="">';
		html+='<div class="layui-form-item" style="margin-top:40px;margin-right:20px;">';
		html+='	<label class="layui-form-label" style="width:150px">快递公司</label>';
		html+='	<div class="layui-input-inline" style="width:180px">';
		html+='		<select id="plfh_express" name="plfh_express" style="width:100%;height: 38px;line-height: 38px;border:1px solid #e6e6e6;background-color: #fff;border-radius: 2px;">';
		{foreach $express_data as $k=>$v}
		html+='			<option>{$k}</option>';
		{/foreach}
		html+='		</select>';
		html+='	</div>';
		html+='</div>';
		html+='	<div class="layui-form-item">';
		html+='		<label class="layui-form-label" style="width:150px">上传EXCEL文件：</label>';
		html+='		<div class="layui-input-inline" style="width:300px">';
		html+='			<input type="text" name="plfh_file" id="plfh_file" class="layui-input">';
		html+='		</div>';
		html+='		<button style="float:left;" type="button" class="layui-btn layui-btn-primary uploadexcel" upload-input="plfh_file">上传</button>';
		//html+='		<div class="layui-form-mid layui-word-aux"></div>';
		html+='	</div>';
		html+='	<div class="layui-form-item">';
		html+='		<label class="layui-form-label" style="width:150px"></label>';
		html+='		<div class="layui-form-mid"> <a href="__STATIC__/demo_plfh.xls">点击下载查看导入格式</a></div>';
		html+='	</div>';
		html+='	<div class="layui-form-item" style="margin-top:30px">';
		html+='		<label class="layui-form-label" style="width:150px"></label>';
		html+='		<div class="layui-input-inline">';
		html+='			<button class="layui-btn layui-btn-normal" lay-submit lay-filter="submit_excel">确定导入发货</button>';
		html+='		</div>';
		html+='	</div>';
		html+='</div>';
		html+='</div>'
		var plfhLayer = layer.open({type:1,area: ['600px', '460px'],title:'导入EXCEl文件',content:html,shadeClose:true})
		layui.form.render();
		//文件上传
		layui.upload.render({
			elem: '.uploadexcel',
			accept:'file',
			url:"{:url('upload/index')}",
			done: function(res){
				if(res.status==0){
					dialog(res.msg,0);
				}else{
					var item = this.item;
					var inputid = $(this.item).attr('upload-input');
					if(inputid){
						$('#'+inputid).val(res.url);
						$('#'+inputid).change();
					}
				}
			}
		});
		layui.form.on('submit(submit_excel)', function(obj){
			var field = obj.field;
			var index= layer.load();
			$.post("{:url('plfh')}",field,function(res){
				layer.close(index);
				dialog(res.msg,res.status);
				layer.close(plfhLayer);
				tableIns.reload();
			})
		})
	}
		//批量发货-云仓
		function plfhyc(){
			var html = '<div style="margin:20px auto;">';
			html+='<div class="layui-form" lay-filter="">';
			html+='<div class="layui-form-item" style="margin-top:40px;margin-right:20px;">';

				html+='</div>';
				html+='	<div class="layui-form-item">';
				html+='		<label class="layui-form-label" style="width:150px">上传EXCEL文件：</label>';
				html+='		<div class="layui-input-inline" style="width:300px">';
				html+='			<input type="text" name="plfhyc_file" id="plfhyc_file" class="layui-input">';
				html+='		</div>';
				html+='		<button style="float:left;" type="button" class="layui-btn layui-btn-primary uploadexcel2" upload-input="plfhyc_file">上传</button>';
				//html+='		<div class="layui-form-mid layui-word-aux"></div>';
				html+='	</div>';
				html+='	<div class="layui-form-item">';
				html+='		<label class="layui-form-label" style="width:150px"></label>';
				html+='		<div class="layui-form-mid"> <a href="__STATIC__/demo_plfhyc.xlsx">点击下载查看导入格式</a></div>';
				html+='	</div>';
				html+='	<div class="layui-form-item" style="margin-top:30px">';
				html+='		<label class="layui-form-label" style="width:150px"></label>';
				html+='		<div class="layui-input-inline">';
				html+='			<button class="layui-btn layui-btn-normal" lay-submit lay-filter="submit_excel2">确定导入发货</button>';
				html+='		</div>';
				html+='	</div>';
				html+='</div>';
				html+='</div>'
				var plfhLayer = layer.open({type:1,area: ['600px', '460px'],title:'导入EXCEl文件',content:html,shadeClose:true})
				layui.form.render();
				//文件上传
				layui.upload.render({
					elem: '.uploadexcel2',
					accept:'file',
					url:"{:url('upload/index')}",
					done: function(res){
						if(res.status==0){
							dialog(res.msg,0);
						}else{
							var item = this.item;
							var inputid = $(this.item).attr('upload-input');
							if(inputid){
								$('#'+inputid).val(res.url);
								$('#'+inputid).change();
							}
						}
					}
				});
				layui.form.on('submit(submit_excel2)', function(obj){
					var field = obj.field;
					var index= layer.load();
					$.post("{:url('plfhyc')}",field,function(res){
						layer.close(index);
						dialog(res.msg,res.status);
						layer.close(plfhLayer);
						tableIns.reload();
					})
				})
			}
	</script>

  
	<script id="refundCheckTpl" type="text/html">
		<div class="orderdetail">
		<div class="orderinfo">
				<div class="item">
					<span class="t1">申请退款金额</span>
					<span class="t2 red">￥{{d.refund_money}}</span>
				</div>
				<div class="item">
					<span class="t1">申请退款原因</span>
					<span class="t2 red">{{d.refund_reason}}</span>
				</div>
				<div class="item">
					<span class="t1">申请退款时间</span>
					<span class="t2">{{date('Y-m-d H:i:s',d.refund_time)}}</span>
				</div>
				<div class="item">
					<span class="t1">审核备注</span>
					<span class="t2"><input type="text" name="refund_checkremark" value="{{d.refund_checkremark ? d.refund_checkremark : ''}}" style="height:30px"/></span>
				</div>
		</div>
		</div>
	</script>
	<script id="logisticsTpl" type="text/html">
	<div style="padding:5px"></div>
	{{# if(d.data.length==0){ }}<div style="font-size:14px;color:#f05555;padding:10px;"><i class="fa fa-info-circle"></i> 暂未查到物流信息</div>{{# } }}
	{{# if(d.data.length>0){ }}
	<div class="layui-tab layui-tab-brief" lay-filter="mytab">
		<ul class="layui-tab-title">
			{{#  layui.each(d.data, function(index, item){ }}
			<li  class="{{index==0?'layui-this':''}}" lay-id="{{index}}">{{item.express_com}}-{{item.express_no}}</li>
			{{# }); }}
		</ul>
		<div class="layui-tab-content">
			{{#  layui.each(d.data, function(index, item){ }}
			<div class="layui-tab-item {{index==0?'layui-show':''}}">
				{{# if((item.oglist).length>0){ }}
					<div class="product">
					{{#  layui.each(item.oglist, function(index2, item2){ }}
					<div class="content">
						<div>
							<img src="{{item2.pic}}"/>
						</div>
						<div class="detail">
							<span class="t1">{{item2.name}}</span>
							<span class="t2">{{item2.ggname}}</span>
							<div class="t3"><span class="x1 flex1">￥{{item2.sell_price}}</span><span class="x2">×{{item2.num}}</span></div>
						</div>
					</div>
					{{# }); }}
					</div>
				{{# } }}
				{{# if((item.express_data).length>0){ }}
				<ul class="layui-timeline">
				{{#  layui.each(item.express_data, function(index2, item2){ }}
					<li class="layui-timeline-item">
						<i class="layui-icon layui-timeline-axis {{index2==0?'on':''}}"></i>
						<div class="layui-timeline-content layui-text">
							<p>{{item2.time}}</p>
							<p>
								{{item2.context}}
							</p>
						</div>
					</li>
				{{# }); }}
				</ul>
				{{# }else{ }}
				<div style="padding:20px 0 20px 0;font-size:16px">暂未查到物流信息</div>
				{{# } }}
			</div>
			{{# }); }}
		</div>
	</div>
	{{# } }}
	</script>

	<script id="sendExpressTpl" type="text/html">
	<div id="sendExpressDiv" style="margin:0 20px" class="layui-form" lay-filter="">
		<div id="sendExpressContent">
			{{# if(d.order.express_content){ }}
			{{#  layui.each(d.order.express_content, function(index, item){ }}
			<div class="sendExpressContentadd">
			<div class="layui-form-item" style="margin-top:40px;">
				<label class="layui-form-label" style="width:60px">快递公司</label>
				<div class="layui-input-inline" style="width:180px">
					<select name="send_express[]" style="width:100%;height: 38px;line-height: 38px;border:1px solid #e6e6e6;background-color: #fff;border-radius: 2px;">
						{foreach $express_data as $k=>$v}
						<option {{# if(item.express_com=='{$k}'){ }}selected{{# } }}>{$k}</option>
						{/foreach}
					</select>
				</div>
				{{# if(index > 0){ }}
				<div class="layui-form-mid" onclick="$(this).parent().parent().remove()" style="cursor:pointer">移除</div>
				{{# } }}
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label" style="width:60px">快递单号</label>
				<div class="layui-input-inline" style="width:180px">
					<input type="text" name="send_express_no[]" class="layui-input" value="{{# if(item.express_no){ }}{{item.express_no}}{{# } }}">
				</div>
			</div>
			{{# if((d.oglist).length > 1){ }}
			<div class="layui-form-item">
				<label class="layui-form-label" style="width:60px">发货商品</label>
				<div class="layui-input-inline send_express_ogids" style="width:400px">
					{{#  layui.each(d.oglist, function(index2, item2){ }}
					<input type="checkbox" class="layui-input" value="{{item2.id}}" {{# if($.inArray(item2.id+'',item.express_ogids) > -1){ }}checked{{# } }} title="{{item2.name}}({{item2.ggname}})" lay-skin="primary">
					{{# }); }}
				</div>
			</div>
			{{# } }}
			<hr>
			</div>

			{{# }); }}
			{{# }else{  }}
			<div class="layui-form-item" style="margin-top:40px;">
				<label class="layui-form-label" style="width:60px">快递公司</label>
				<div class="layui-input-inline" style="width:180px">
					<select name="send_express[]" style="width:100%;height: 38px;line-height: 38px;border:1px solid #e6e6e6;background-color: #fff;border-radius: 2px;">
						{foreach $express_data as $k=>$v}
						<option {{# if(d.order.express_com=='{$k}'){ }}selected{{# } }}>{$k}</option>
						{/foreach}
					</select>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label" style="width:60px">快递单号</label>
				<div class="layui-input-inline" style="width:180px">
					<input type="text" name="send_express_no[]" class="layui-input" value="{{# if(d.order.express_no){ }}{{d.order.express_no}}{{# } }}">
				</div>
			</div>
			{{# if((d.oglist).length > 1){ }}
			<div class="layui-form-item">
				<label class="layui-form-label" style="width:60px">发货商品</label>
				<div class="layui-input-inline send_express_ogids" style="width:400px">
					{{#  layui.each(d.oglist, function(index2, item2){ }}
					<input type="checkbox" value="{{item2.id}}" {{# if($.inArray(item2.id+'',d.order.express_ogids) > -1){ }}checked{{# } }} title="{{item2.name}}({{item2.ggname}})" lay-skin="primary">
					{{# }); }}
				</div>
			</div>
			{{# } }}
			<hr>
			{{# } }}
		</div>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" onclick="addsendExpressContent()">新增一个</a>
	</div>
	</script>
	<script>
	function addsendExpressContent(){
		console.log(orderdata)
		var addhtml = '<div class="sendExpressContentadd">';
		addhtml += '	<div class="layui-form-item" style="margin-top:40px;">';
		addhtml += '		<label class="layui-form-label" style="width:60px">快递公司</label>';
		addhtml += '		<div class="layui-input-inline" style="width:180px">';
		addhtml += '			<select name="send_express[]" style="width:100%;height: 38px;line-height: 38px;border:1px solid #e6e6e6;background-color: #fff;border-radius: 2px;">';
						{foreach $express_data as $k=>$v}
		addhtml += '				<option>{$k}</option>';
						{/foreach}
		addhtml += '			</select>';
		addhtml += '		</div>';
		addhtml += '		<div class="layui-form-mid" onclick="$(this).parent().parent().remove()" style="cursor:pointer">移除</div>';
		addhtml += '	</div>';
		addhtml += '	<div class="layui-form-item">';
		addhtml += '		<label class="layui-form-label" style="width:60px">快递单号</label>';
		addhtml += '		<div class="layui-input-inline" style="width:180px">';
		addhtml += '			<input type="text" name="send_express_no[]" class="layui-input" value="">';
		addhtml += '		</div>';
		addhtml += '	</div>';
		if((orderdata.oglist).length > 1){
			addhtml += '	<div class="layui-form-item">';
			addhtml += '		<label class="layui-form-label" style="width:60px">发货商品</label>';
			addhtml += '		<div class="layui-input-inline send_express_ogids" style="width:400px">';
			layui.each(orderdata.oglist, function(index2, item2){
				addhtml += '	<input type="checkbox" value="'+item2.id+'" title="'+item2.name+'('+item2.ggname+')" lay-skin="primary">';
			});
			addhtml += '		</div>';
			addhtml += '	</div>';
		}
		addhtml += '	<hr>';
		addhtml += '</div>';
		$('#sendExpressContent').append(addhtml);
		layui.form.render();
	}
	</script>

	<script id="remarktpl" type="text/html">
	<div class="layui-form-item" style="margin-top:40px;margin-right:20px;">
		<label class="layui-form-label" style="width:40px">备注</label>
		<div class="layui-input-inline" style="width:180px">
			<input type="text" id="remarkcontent" class="layui-input" value="{{d.remark?d.remark : ''}}">
		</div>
	</div>
	</script>
	<script id="changepricetpl" type="text/html">
	<div class="layui-form-item" style="margin-top:40px;margin-right:20px;">
		<label class="layui-form-label" style="width:40px">价格</label>
		<div class="layui-input-inline" style="width:180px">
			<input type="text" id="changepricecontent" class="layui-input" value="{{d.totalprice?d.totalprice : ''}}">
		</div>
	</div>
	</script>

	<script id="detailtpl" type="text/html">
	<div class="orderdetail">
		<div class="address">
			<div class="img">
				<img src="__STATIC__/admin/img/address.png" class="buy-addimg"/>
			</div>
			<div class="info">
				<span class="t1">{{d.order.linkman}}{{# if(d.order.company){ }} {{d.order.company}} {{# } }} {{d.order.tel}}</span>
				<span class="t2">{{d.order.area}}{{d.order.address}}</span>
			</div>
		</div>
		{{# if(d.order.send_time && d.order.freight_type!=3 && d.order.freight_type!=4){ }}
		<div class="express">
			<div class="f1"><i class="fa fa-truck"></i></div>
			<div class="f2">
				{{# if(d.order.express_content){ }}
				{{#  layui.each(d.order.express_content, function(index, item){ }}
				<span class="log-te1">{{item.express_com}}：{{item.express_no}}</span>
				{{# }); }}
				{{# }else{ }}
				<span class="log-te1">快递公司：{{d.order.express_com}}</span>
				<span class="log-te1">快递单号：{{d.order.express_no}}</span>
				{{# } }}
			</div>
		</div>
		{{# } }}
		{{# if(d.order.send_time && (d.order.freight_type==3 || d.order.freight_type==4)){ }}
		<div class="express">
			<div class="f1"><i class="fa fa-file-text"></i></div>
			<div class="f2"><pre>{{d.order.freight_content}}</pre></div>
		</div>
		{{# } }}

		<div class="product">
			{{#  layui.each(d.oglist, function(index, item){ }}
			<div class="box">
				<div class="content">
					<div>
						<img src="{{item.pic}}"/>
					</div>
					<div class="detail">
						<span class="t1">{{item.name}}</span>
						<span class="t2">{{item.ggname}}</span>
						<div class="t3"><span class="x1 flex1">￥{{item.sell_price}}</span><span class="x2">×{{item.num}}</span></div>
					</div>
				</div>
				{{# if(item.glassrecord){ }}
				<div class="glassitem">
					<div>
						{{#  if(item.glassrecord.type==1){ }}
						近视
						{{# }else{ }}
						远视
						{{# } }}
						，右眼/{{item.glassrecord.degress_right}}度，左眼/{{item.glassrecord.degress_left}}度，瞳距/{{item.glassrecord.ipd}}mm，矫正右/{{item.glassrecord.correction_right}}，矫正左/{{item.glassrecord.correction_left}}
					</div>
					{{#  if(item.glassrecord.is_ats==1){ }}
					<div>
						散光，柱镜右/{{item.glassrecord.ats_right}}度，柱镜左/{{item.glassrecord.ats_left}}度，轴位右/{{item.glassrecord.ats_zright}}度，轴位左/{{item.glassrecord.ats_zleft}}度
					</div>
					{{# } }}

				</div>
				{{# } }}

			</div>
			{{# }); }}
		</div>
		
		{{#  if((d.order.formdata).length>0){ }}
		<div class="orderinfo">
			{{#  layui.each(d.order.formdata, function(index, item){ }}
			<div class="item">
				<span class="t1">{{item[0]}}</span>
				{{#  if(item[2]=='upload'){ }}
				<span class="t2"><img src="{{item[1]}}" style="width:150px;height:auto" onclick="preview(this)"/></span>
				{{# }else{ }}
				<span class="t2">{{item[1]}}</span>
				{{# } }}
			</div>
			{{# }); }}
		</div>
		{{# } }}
		
		{{#  if(d.order.message || d.order.remark || d.order.field1 || d.order.field2 || d.order.field3 || d.order.field4 || d.order.field5){ }}
		<div class="orderinfo">
			{{#  if(d.order.message){ }}
			<div class="item">
				<span class="t1">客户备注</span>
				<span class="t2 red">{{d.order.message ? d.order.message : '无'}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.field1){ }}
			<div class="item">
				<span class="t1">{{d.order.field1data[0]}}</span>
				<span class="t2 red">{{d.order.field1data[1]}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.field2){ }}
			<div class="item">
				<span class="t1">{{d.order.field2data[0]}}</span>
				<span class="t2 red">{{d.order.field2data[1]}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.field3){ }}
			<div class="item">
				<span class="t1">{{d.order.field3data[0]}}</span>
				<span class="t2 red">{{d.order.field3data[1]}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.field4){ }}
			<div class="item">
				<span class="t1">{{d.order.field4data[0]}}</span>
				<span class="t2 red">{{d.order.field4data[1]}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.field5){ }}
			<div class="item">
				<span class="t1">{{d.order.field5data[0]}}</span>
				<span class="t2 red">{{d.order.field5data[1]}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.remark){ }}
			<div class="item">
				<span class="t1">后台备注</span>
				<span class="t2 red">{{d.order.remark ? d.order.remark : '无'}}</span>
			</div>
			{{# } }}
		</div>
		{{# } }}
		<div class="orderinfo">
			<div class="item">
				<span class="t1">下单人</span>
				<span class="t2"><img src="{{d.member.headimg}}" style="width:40px"/> {{d.member.nickname}} {{# if(d.member.realname){ }}[{{d.member.realname}} {{d.member.tel}}]{{#} }}</span>
			</div>
			<div class="item">
				<span class="t1">{:t('会员')}ID</span>
				<span class="t2">{{d.member.id}}</span>
			</div>
			{{#  if(d.order.school_info){ }}
				<div class="item">
					<span class="t1">班级信息</span>
					<span class="t2">{{d.order.school_info}}</span>
				</div>
			{{# } }}

		</div>
		<div class="orderinfo">
			<div class="item">
				<span class="t1">订单编号</span>
				<span class="t2">{{d.order.ordernum}}</span>
			</div>
			<div class="item">
				<span class="t1">下单时间</span>
				<span class="t2">{{date('Y-m-d H:i:s',d.order.createtime)}}</span>
			</div>
			{{#  if(d.order.status>0 && d.order.paytime){ }}
			<div class="item">
				<span class="t1">支付时间</span>
				<span class="t2">{{date('Y-m-d H:i:s',d.order.paytime)}}</span>
			</div>
			<div class="item">
				<span class="t1">支付方式</span>
				<span class="t2">{{d.order.paytype}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.status>1 && d.order.send_time){ }}
			<div class="item">
				<span class="t1">发货时间</span>
				<span class="t2">{{date('Y-m-d H:i:s',d.order.send_time)}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.status==3 && d.order.collect_time){ }}
			<div class="item">
				<span class="t1">收货时间</span>
				<span class="t2">{{date('Y-m-d H:i:s',d.order.collect_time)}}</span>
			</div>
			{{# } }}
		</div>
		<div class="orderinfo">
			<div class="item">
				<span class="t1">商品金额</span>
				<span class="t2 red">¥{{d.order.product_price}}</span>
			</div>
			{{#  if(d.order.leveldk_money > 0){ }}
			<div class="item">
				<span class="t1">{:t('会员')}折扣</span>
				<span class="t2 red">-¥{{d.order.leveldk_money}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.manjian_money > 0){ }}
			<div class="item">
				<span class="t1">满减活动</span>
				<span class="t2 red">-¥{{d.order.manjian_money}}</span>
			</div>
			{{# } }}
			<div class="item">
				<span class="t1">配送方式</span>
				<span class="t2">{{d.order.freight_text}}</span>
			</div>
			{{#  if(d.order.freight_type==11){ }}
			<div class="item">
				<span class="t1">发货地址</span>
				<span class="t2">{{d.order.freight_content.send_address}} - {{d.order.freight_content.send_tel}}</span>
			</div>
			<div class="item">
				<span class="t1">收货地址</span>
				<span class="t2">{{d.order.freight_content.receive_address}} - {{d.order.freight_content.receive_tel}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.freight_time){ }}
			<div class="item">
				<span class="t1">{{d.order.freight_type!=1?'配送':'提货'}}时间</span>
				<span class="t2">{{d.order.freight_time}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.invoice_money > 0){ }}
			<div class="item">
				<span class="t1">发票费用</span>
				<span class="t2 red">¥{{d.order.invoice_money}}</span>
			</div>
			{{# } }}
			{{#  if(d.order.coupon_money > 0){ }}
			<div class="item">
				<span class="t1">{:t('优惠券')}抵扣</span>
				<span class="t2 red">-¥{{d.order.coupon_money}}</span>
			</div>
			{{#  if(d.couponnames){ }}
			<div class="item">
				<span class="t1">{:t('优惠券')}名称</span>
				<span class="t2">{{d.couponnames}}</span>
			</div>
			{{# } }}
			{{# } }}
			{{#  if(d.order.scoredk_money > 0){ }}
			<div class="item">
				<span class="t1">{:t('积分')}抵扣</span>
				<span class="t2 red">-¥{{d.order.scoredk_money}}</span>
			</div>
			{{# } }}
			<div class="item">
				<span class="t1">实付款</span>
				<span class="t2 red">¥{{d.order.totalprice}}</span>
			</div>
			<div class="item">
				<span class="t1">订单状态</span>
				{{#  if(d.order.status==0){ }}
				<span class="t2" style="color:#ff8758">未付款</span>
				{{# } }}
				{{#  if(d.order.status==1 && d.order.paytypeid=='4'){ }}
				<span class="t2" style="color:#008000">待发货</span>
				{{# } }}
				{{#  if(d.order.status==1 && d.order.paytypeid!='4'){ }}
				<span class="t2" style="color:#008000">已支付</span>
				{{# } }}
				{{#  if(d.order.status==2){ }}
				<span class="t2" style="color:#ff4246">已发货</span>
				{{# } }}
				{{#  if(d.order.status==3){ }}
				<span class="t2" style="color:#999">已收货</span>
				{{# } }}
				{{#  if(d.order.status==4){ }}
				<span class="t2" style="color:#bbb">已关闭</span>
				{{# } }}
			</div>
			{{#  if(d.order.balance_price>0){ }}
			<div class="item">
				<span class="t1">尾款金额</span>
				<span class="t2 red">¥{{d.order.balance_price}}</span>
			</div>
			<div class="item">
				<span class="t1">尾款状态</span>
				{{#  if(d.order.balance_pay_status==1){ }}
				<span class="t2">已支付</span>
				{{# } }}
				{{#  if(d.order.balance_pay_status==0){ }}
				<span class="t2">未支付</span>
				{{# } }}
			</div>
			{{# } }}
			{{#  if(d.order.refund_status>0){ }}
			<div class="item">
				<span class="t1">退款状态</span>
				{{#  if(d.order.refund_status==1){ }}
				<span class="t2 red">审核中,¥{{d.order.refund_money}}</span>
				{{# } }}
				{{#  if(d.order.refund_status==2){ }}
				<span class="t2 red">已退款,¥{{d.order.refund_money}}</span>
				{{# } }}
				{{#  if(d.order.refund_status==3){ }}
				<span class="t2 red">已驳回,¥{{d.order.refund_money}}</span>
				{{# } }}
			</div>
			{{# } }}
			{{#  if(d.order.refund_checkremark){ }}
			<div class="item">
				<span class="t1">审核备注</span>
				<span class="t2 red">{{d.order.refund_checkremark}}</span>
			</div>
			{{# } }}
		</div>
		{{#  if(d.order.checkmemid > 0){ }}
		<div class="orderinfo">
			<div class="item">
				<span class="t1">所选{:t('会员')}</span>
				<span class="t2"><img src="{{d.checkmember.headimg}}" style="width:30px"/> {{d.checkmember.nickname}}</span>
			</div>
		</div>
		{{# } }}
		{{#  if(d.comdata.parent1.mid){ }}
		<div class="orderinfo">
			<div class="item">
				<span class="t1">一级{:t('佣金')}</span>
				<span class="t2"><img src="{{d.comdata.parent1.headimg}}" style="width:30px"/> {{d.comdata.parent1.nickname}} <span style="color:#ff8758">{{d.comdata.parent1.money}}元 {{#  if(d.comdata.parent1.score){ }}+{{d.comdata.parent1.score}}{:t('积分')}{{# } }}</span></span>
			</div>
			<div class="item">
				<span class="t1">二级{:t('佣金')}</span>
				<span class="t2"><img src="{{d.comdata.parent2.headimg}}" style="width:30px"/> {{d.comdata.parent2.nickname}}  <span style="color:#ff8758">{{d.comdata.parent2.money}}元 {{#  if(d.comdata.parent2.score){ }}+{{d.comdata.parent2.score}}{:t('积分')}{{# } }}</span></span>
			</div>
			<div class="item">
				<span class="t1">三级{:t('佣金')}</span>
				<span class="t2"><img src="{{d.comdata.parent3.headimg}}" style="width:30px"/> {{d.comdata.parent3.nickname}}  <span style="color:#ff8758">{{d.comdata.parent3.money}}元  {{#  if(d.comdata.parent3.score){ }}+{{d.comdata.parent3.score}}{:t('积分')}{{# } }}</span></span>
			</div>
		</div>
		{{# } }}
	</div>
	</script>

  <script id="refundtpl" type="text/html">
	  <div class="orderdetail">
		  <div class="product">

			  {{#  layui.each(d.prolist, function(index, item){ }}
			  <div class="content">
				  <div>
					  <img src="{{item.pic}}"/>
				  </div>
				  <div class="detail">
					  <span class="t1">{{item.name}}</span>
					  <span class="t2">{{item.ggname}}</span>
					  <div class="t3"><span class="x1 flex1">￥{{item.sell_price}}×{{item.num}}</span><span style="color: #999;font-size: 12px;">最多可退{{item.canRefundNum}}件</span>
						  <div class="layui-form-item">
						  	<div class="layui-input-inline" style="width:50px">
								<input type="number" name="refundNum[]" min="0" max="{{item.canRefundNum}}" data-ogid="{{item.id}}" data-order="{{d.detail.id}}" value="{{item.canRefundNum}}" class="layui-input refundNum" onchange="refundChange(this)" style="height: 28px; margin-top: -8px; margin-left: 2px;"></div>
					 	  </div>
					  </div>
				  </div>
			  </div>
			  {{# }); }}
		  </div>

		  <div class="orderinfo">
			  <div class="layui-form-item">
				  <label class="layui-form-label" style="width:90px">退款原因</label>
				  <div class="layui-input-inline" style="width:300px">
					  <textarea type="text" id="tuireason" class="layui-textarea"></textarea>
				  </div>
			  </div>
			  <div class="layui-form-item">
				  <label class="layui-form-label" style="width:90px">退款金额</label>
				  <div class="layui-input-inline" style="width:300px">
					  <input type="number" name="money" id="refund_money" min="0" max="{{d.detail.returnTotalprice}}" value="{{d.detail.returnTotalprice}}" class="layui-input">
				  </div>
			  </div>
		  </div>
	  </div>

  </script>
  <script>

	  function refundChange(e)
	  {
		  var order = tuikuandata;
		  var newnum = parseInt($(e).val());
		  var maxnum = parseInt($(e).attr('max'));
		  if (newnum > maxnum) {
			  layer.msg('请输入正确数量');return false;
		  }
		  var total = 0;
		  var refundTotalNum = 0;
		  var refundNum = [];
		  $(".refundNum").each(function(){
			  refundNum.push({ogid:$(this).attr('data-ogid'),num:$(this).val()})
		  });

		  for(var i in refundNum) {
			  if(refundNum[i].num == order.prolist[i].num)
				  total += parseFloat(order.prolist[i].real_totalprice);
			  else {
				  total += refundNum[i].num * parseFloat(order.prolist[i].real_totalprice) / order.prolist[i].num;
			  }
			  refundTotalNum += refundNum[i].num;
		  }
		  if(refundTotalNum == order.detail.totalNum || refundTotalNum == order.detail.canRefundNum) {
			  total = order.detail.returnTotalprice;
		  }
		  total = parseFloat(total);
		  total = total.toFixed(2);
		  $('#refund_money').val(total);
	  }

		function fhjiesuan(){
			var html = '';
			html+='	<div class="layui-form-item" style="margin-top:40px;margin-right:20px;">';
			html+='		<label class="layui-form-label" style="width:80px">时间范围：</label>';
			html+='		<div class="layui-input-inline" style="width:200px">';
			html+='			<input type="text" name="jiesuan_ctime" id="jiesuan_ctime" autocomplete="off" class="layui-input">';
			html+='		</div>';
			html+='		<div class="layui-form-mid layui-word-aux" style="margin-left:110px">订单确认收货的时间范围</div>';
			html+='	</div>';
			html+='	<div class="layui-form-item" style="margin-right:20px;">';
			html+='		<label class="layui-form-label" style="width:80px">订单数：</label>';
			html+='		<div class="layui-form-mid" id="jiesuan_ordercount" style="font-weight:bold"></div>';
			html+='	</div>';
			html+='	<div class="layui-form-item" style="margin-right:20px;">';
			html+='		<label class="layui-form-label" style="width:80px">订单金额：</label>';
			html+='		<div class="layui-form-mid" id="jiesuan_orderprice" style="font-weight:bold"></div>';
			html+='	</div>';
			var addscoreLayer = layer.open({type:1,area:['500px','300px'],title:false,content:html,shadeClose:true,btn: ['确定', '取消'],
				yes:function(){
					var index = layer.load();
					$.post("{:url('fhjiesuan')}",{ ctime: $('#jiesuan_ctime').val()},function(res){
						layer.close(index);
						dialog(res.msg,res.status);
						layer.close(addscoreLayer);
						tableIns.reload();
					})
				}
			});
			layui.form.render();
			//日期范围选择
			layui.laydate.render({ 
				elem: '#jiesuan_ctime',
				trigger: 'click',
				range: '~', //或 range: '~' 来自定义分割字符
				done:function(value){
					var index = layer.load();
					$.post("{:url('getordercount')}",{ctime:value},function(res){
						layer.close(index);
						$('#jiesuan_ordercount').html(res.ordercount+'单');
						$('#jiesuan_orderprice').html('￥'+res.orderprice);
					});
				}
			});
		}
		
  </script>
	{include file="public/copyright"/}
</body>
</html>